Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: component client samples update #1706

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

aludwiko
Copy link
Contributor

@aludwiko aludwiko commented Jun 26, 2023

References #1335

@github-actions github-actions bot added Documentation Improvements or additions to the documentation java-sdk kalix-runtime Runtime and SDKs sub-team labels Jun 26, 2023
Comment on lines 39 to 46
<1> `KalixClient` is injected on the constructor. It will be used to build calls to the underlining Entity.
<1> `ComponentClient` is injected on the constructor. It will be used to build calls to the underlining Entity.
<2> Expose the command handler as a `POST` endpoint at specified path.
<3> Check if the added item is carrots.
<4> If it is "carrots" immediately return an error, disallowing adding the item.
<5> For allowed requests, use `kalixClient` to get a deferred call to the entity.
<5> For allowed requests, use `componentClient` to get a deferred call to the entity.
<6> The `deferredCall` is then used with `effects().forward()` to forward the request to the entity.

NOTE: You might be wondering what the `kalixClient` is about. For now, think of it as a lightweight HTTP client allowing you to reach out to other Kalix services. All details can be found at xref:call-another-service.adoc[] chapter.
NOTE: You might be wondering what the `componentClient` is about. For now, think of it as a lightweight, type safe, HTTP client allowing you to reach out to other Kalix services. All details can be found at xref:call-another-service.adoc[] chapter.
Copy link
Member

@efgpinto efgpinto Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this file actions-as-controller.adoc was deleted in main with the menu restructure. Now this content is under actions.adoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR updated

Base automatically changed from 1335-spring-sdk-typed-kalixclient to main June 27, 2023 09:01
@aludwiko aludwiko force-pushed the 1335-spring-sdk-typed-kalixclient-samples branch from dbe50be to f9277f8 Compare June 27, 2023 09:07
@aludwiko aludwiko marked this pull request as ready for review June 27, 2023 09:07
@aludwiko aludwiko force-pushed the 1335-spring-sdk-typed-kalixclient-samples branch from f9277f8 to 899c3be Compare June 27, 2023 09:12
Copy link
Member

@octonato octonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ComponentClient is really nice!

@aludwiko aludwiko merged commit 8c7b5d2 into main Jun 27, 2023
65 checks passed
@aludwiko aludwiko deleted the 1335-spring-sdk-typed-kalixclient-samples branch June 27, 2023 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to the documentation java-sdk kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants